﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace OperaHouse.Web
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            //home page
            routes.MapRoute(
                name: "HomePage",
                url:  "",
                defaults: new { controller = "Home", action = "Index" },
                namespaces: new[] { "OperaHouse.Web.Controllers" });
            
            //opera
            routes.MapRoute(
                name: "Opera",
                url:  "bieu-dien-nghe-thuat-dinh-ky/{SystemName}",
                defaults: new { controller = "Opera", action = "OperaDetails" },
                namespaces: new[] { "OperaHouse.Web.Controllers" });

            //activity
            routes.MapRoute(
                name: "Activity",
                url: "hoat-dong-nghe-thuat/{SystemNameActivity}",
                defaults: new { controller = "Activity", action = "ActivityDetails"},
                namespaces: new[] { "OperaHouse.Web.Controllers" });

            //welfare
            routes.MapRoute(
                name: "Welfare",
                url: "bieu-dien-cong-ich/{SystemNameWelfare}",
                defaults: new { controller = "Welfare", action = "WelfareDetails" },
                namespaces: new[] { "OperaHouse.Web.Controllers" });

            //intro
            routes.MapRoute(
                name: "Intro",
                url: "gioi-thieu/{SystemNameIntro}",
                defaults: new { controller = "Intro", action = "IntroDetails" },
                namespaces: new[] { "OperaHouse.Web.Controllers" });

            //tin-tuc
            routes.MapRoute(
                name: "News",
                url: "tin-tuc",
                defaults: new { controller = "News", action = "Index" },
                namespaces: new[] { "OperaHouse.Web.Controllers" });

            //tin-tuc-chi-tiet
            routes.MapRoute(
                name: "NewsDetail",
                url: "tin-tuc/{id}",
                defaults: new { controller = "News", action = "Detail" },
                namespaces: new[] { "OperaHouse.Web.Controllers" });

            //concert
            routes.MapRoute(
                name: "Concert",
                url: "lich-bieu-dien",
                defaults: new { controller = "Concert", action = "Index" },
                namespaces: new[] { "OperaHouse.Web.Controllers" });

            //contact us
            routes.MapRoute(
                name: "ContactUs",
                url:  "lien-he",
                defaults: new { controller = "Home", action = "ContactUs" },
                namespaces: new[] { "OperaHouse.Web.Controllers" });

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new[] { "OperaHouse.Web.Controllers" }
            );
        }
    }
}